﻿using System.Collections.Generic;
using Castle.ActiveRecord;

namespace WebConversion.Module
{
    [ActiveRecord]
    public class Category : ActiveRecordBase<Category>
    {
        #region properties
        [PrimaryKey(PrimaryKeyType.Identity, "Id")]
        public int Id { get; set; }
        [Property]
        public string Name { get; set; }
        [Property]
        public string DisplayName { get; set; }
        [Property]
        public string ParentId { get; set; }

        [HasMany(typeof(Category), Table = "Category", ColumnKey = "ParentId")]
        public IList<Category> SubCategories { get; set; }

        /*
        [HasMany(typeof(Product), Table = "Product", ColumnKey = "CategoryId")]
        public IList<Product> Products { get; set; } 
        */
        #endregion
    }
}
